home *** CD-ROM | disk | FTP | other *** search
- /* memcpy.c, from p.152 of Turbo C Bible */
- /* Copies a specified number of bytes of from one buffer to another
- (not for overlapping source and destination). */
- #include <stdio.h>
- #include <mem.h>
- static char src[81] = "This is the SOURCE buffer\n";
- static char dest[81] = "Destination\n";
- main()
- {
- printf("Before memcpy: Source = %s Destination = %s\n", src, dest);
- memcpy(dest, src, 80); /* Copy from source to destination */
- printf("After memcpy: Source = %s Destination = %s\n", src, dest);
- }